<template>
  <div :class="['com-tabbar-container', cname]">
    <span hidden>通用tapbar布局</span>
    <van-icon @click="routerBack" class="tabber-back-icon" name="arrow-left" size="20"/>
    <h3 v-if="title" class="tabber-title">{{title}}</h3>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    cname: {
      // 接收外部样式
      type: String,
      default: ''
    }
  },
  methods: {
    routerBack() {
      this.$router.go(-1)
    }
  }
}
</script>

<style lang="scss" scoped>
@import "../assets/style/global.scss";

.com-tabbar-container {
  position: relative;
  width: 100%;
  height: 50px;
  @include flex;
  align-items: center;
  padding: 10px;
  .tabber-back-icon {
    position: fixed;
    top: 15px;
    left: 10px;
    z-index: 99;
  }
  .tabber-title {
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
  }
}
</style>